inherited dm_classificacaoterapeutica: Tdm_classificacaoterapeutica
  OldCreateOrder = True
  Left = 438
  Top = 233
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '    z.cod_classificacao,'
      '    z.descricao,'
      '    z.data_cad,'
      '    z.data_alteracao,'
      '    z.situacao,'
      '    case'
      '      when z.situacao = '#39'True'#39' then '#39'ATIVA'#39' else '#39'INATIVA'#39
      '    end as situacao_desc,'
      '    count(a.lig_cod_class_terapeutica) as involucro,'
      '    count(b.lig_cod_class_terapeutica) as excipiente,'
      '    count(c.lig_cod_class_terapeutica) as embalagem'
      'from F_CLASSIFICACAO_TERAPEUTICA z'
      
        'left join f_involucro a on (a.lig_cod_class_terapeutica = z.cod_' +
        'classificacao)'
      
        'left join f_excipiente b on (b.lig_cod_class_terapeutica = z.cod' +
        '_classificacao)'
      
        'left join f_embalagem c on (c.lig_cod_class_terapeutica = z.cod_' +
        'classificacao)'
      'where z.cod_classificacao > 0')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_CLASSIFICACAO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_CLASSIFICACAO'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaINVOLUCRO: TIntegerField
      Alignment = taCenter
      FieldName = 'INVOLUCRO'
      Required = True
    end
    object cdsConsultaSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
    object cdsConsultaEXCIPIENTE: TIntegerField
      Alignment = taCenter
      FieldName = 'EXCIPIENTE'
      Required = True
    end
    object cdsConsultaEMBALAGEM: TIntegerField
      Alignment = taCenter
      FieldName = 'EMBALAGEM'
      Required = True
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_f_classificacao_terapeutica,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_CLASSIFICACAO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_CLASSIFICACAO'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsRegistroSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 5
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '    c.cod_classificacao,'
      '    c.descricao,'
      '    c.data_alteracao,'
      '    c.situacao'
      'from F_CLASSIFICACAO_TERAPEUTICA c'
      'where c.cod_classificacao = :codigo')
  end
end
